<template>
    <div>
        <el-dialog @close="closeFn" v-model="visibles" width="45%" :show-close="true">
            <div v-loading="loading" element-loading-text="加载中...">
                <div class="head">{{ item.title }}</div>
                <!-- 时间 -->
                <div class="time">{{ item.date }} {{ item.time }} </div>
                <div class="count">
                    <div class="neiRong" v-html="item.content"></div>
                </div>
                <!-- 这个是左右箭头 -->
                <div class="arrow f f-a-c f-j-c">
                    <!-- <img src="/src/status/jiantou/zuo.png" @click="zuobian" class="zuoImg" alt=""> -->
                    <div class="cent f f-a-c">
                        <div @click="Acquisition" v-if="num == 1" class="caijiImgs f f-a-c f-j-c"><img
                                src="/src/status/jiantou/dk.png" class="dk" alt="">采集</div>
                        <div @click="Acquisition" v-if="num == 2" class="caijiImgs yicaiji f f-a-c f-j-c"><img
                                src="/src/status/img/yicaiji.png" class="dk" alt="">已采集</div>
                        <div @click="Translation" class="caijiImg f f-a-c f-j-c"><img src="/src/status/jiantou/zidian.png"
                                class="dk" alt="">翻译</div>
                    </div>
                    <!-- <img src="/src/status/jiantou/you.png" class="zuoImg" alt=""> -->
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script setup>
import { ref } from 'vue'
const emit = defineEmits(['detilStua', 'Acquisition'])
// import second from ''
let visibles = ref(false)
let loading = ref(false)
let num = ref(1)
// 组件传值
const props = defineProps({
    item: {
        default: {},
        type: Object,
    },

});
// 点击采集
const Acquisition = () => {
    num.value = 2
    emit('Acquisition', props.item)
}
// 点击右上面叉号
const closeFn = () => {
    visibles.value = false
    num.value = 1
}
// 点击左下面箭头
const zuobian = () => {
    console.log(props.item, '00000000');
}
// 点击翻译向父元素传参
const Translation = () => {
    emit('Trmit')
}
// 暴露
defineExpose({
    visibles,
    loading
});
</script>

<style lang="scss" scoped>
@function pxfn($px) {
    @return calc($px / 18.4) * 1vw;
}

.arrow {
    margin-top: pxfn(15);

    .zuoImg {
        width: pxfn(44);
        height: pxfn(44);
    }
}

.caijiImg {
    width: pxfn(78);
    height: pxfn(36);
    background: #f7f8fa;
    border-radius: pxfn(8);
    font-size: pxfn(14);
    font-family: PingFang SC, PingFang SC-400;
    font-weight: 400;
    color: #1d2129;
    margin-left: pxfn(15);
    cursor: pointer;

    .dk {
        width: pxfn(20) !important;
        height: pxfn(20) !important;
        margin-right: pxfn(6);
    }
}

.caijiImg:hover {
    background: #32bbea;
    color: #fff;
}

.caijiImgs {
    width: pxfn(78);
    height: pxfn(36);
    // background: #f7f8fa;
    border-radius: pxfn(8);
    font-size: pxfn(14);
    font-family: PingFang SC, PingFang SC-400;
    font-weight: 400;
    color: #1d2129;
    cursor: pointer;

    .dk {
        width: pxfn(20) !important;
        height: pxfn(20) !important;
        margin-right: pxfn(6);
    }
}

.head {
    font-size: pxfn(22);
    font-family: PingFang SC, PingFang SC-600;
    font-weight: 600;
    text-align: left;
    color: #1d2129;
}

.count {
    height: 60vh;
    overflow-y: auto;

    &::-webkit-scrollbar {
        // 隐藏滚动条将宽度设置为0
        background-color: #e8eaec;
        width: 0 !important;
    }
}

.neiRong {
    font-size: pxfn(14);
    font-family: PingFang SC, PingFang SC-400;
    font-weight: 400;
    // text-align: LEFT;
    color: #4e5769;
    line-height: 2;
}

.time {
    font-size: pxfn(14);
    font-family: PingFang SC, PingFang SC-400;
    font-weight: 400;
    text-align: LEFT;
    color: #868d9c;
    margin: pxfn(15) 0;
}

::v-deep .el-dialog {
    border-radius: pxfn(15) !important;
}

::v-deep .el-dialog__headerbtn {
    font-size: pxfn(26) !important;
}

::v-deep .el-dialog__body {
    padding-top: pxfn(5);
    padding-bottom: pxfn(5);
}

::v-deep .el-dialog {
    --el-dialog-margin-top: 10vh;
}

.yicaiji {
    color: #32bbea;
}
</style>